<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="wrap">
        <button class="btn">删除</button>
        <ul class="list one" title="">
            <li id="first1">01</li>
            <li class="second">02</li>
            <li>03</li>
            <li name="last">04</li>
        </ul>
    </div>
</body>
<script>
    var btn = document.getElementsByClassName("btn")[0];
    var one = document.querySelector(".one");
    var first1 = document.querySelector("#first1");
    var second = document.querySelector(".second");

    // 节点的删除 
    // (1) 自删    Element.remove()    元素自己删除自己
    // (2) 父删    parent.removeChild(node)  由父元素统筹 大义灭亲

    btn.onclick = function(){
        /* if(second){
            second.remove();//自删
            second = null;
        } */
        if(second){
            one.removeChild(second);
            second = null;
        }
    }
</script>

</html>